package com.example.xpvideo.Controller;

import com.example.xpvideo.entity.*;
import com.example.xpvideo.entity.req.LocalMerchantsReq;
import com.example.xpvideo.entity.req.QualificationConfigReq;
import com.example.xpvideo.entity.req.UpdateReq;
import com.example.xpvideo.entity.res.PhpLocalMerchantsRes;
import com.example.xpvideo.mapper.QualificationConfigMapper;
import com.example.xpvideo.service.QualificationConfigService;
import com.example.xpvideo.service.QualificationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * @author : 洪俊新
 * @date : 2021/9/1 11:09
 * @description:
 */
@RestController
@RequestMapping("/back/qualificationconfig")
public class PhpQualificationController {
    @Autowired
    private QualificationConfigService qualificationConfigService;

    /**
     * 资质列表
     * */
    @GetMapping("/list")
    public ResponseResult<PageResult<List<QualificationConfig>>> list(QualificationConfigReq qualificationConfigReq)
            throws Exception{
        return qualificationConfigService.list(qualificationConfigReq);
    }
    @PostMapping("/delete")
    public ResponseResult<Object> delete(@NotNull @RequestBody UpdateReq updateReq)
            throws Exception{
        return qualificationConfigService.delete(updateReq);
    }

    @PostMapping("/insert")
    public ResponseResult<Object> insert(@RequestBody QualificationConfig qualificationConfig)
            throws Exception{
        return qualificationConfigService.insert(qualificationConfig);
    }

    @PostMapping("/update")
    public ResponseResult<Object> update(@RequestBody QualificationConfig qualificationConfig)
            throws Exception{
        return qualificationConfigService.update(qualificationConfig);
    }
}
